﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

using TrivialPurfuit.Business;

namespace TrivialPurfuit.Presentation.Edit
{
    /// <summary>
    /// Interaction logic for EditQuestionsView.xaml
    /// </summary>
    public partial class EditQuestionsView : Window
    {
        public EditQuestionsView()
        {
            InitializeComponent();
        }

        private void EditCategories_Click(object sender, RoutedEventArgs e)
        {
            Presentation.Edit.EditCategoriesView editCategoriesView = new EditCategoriesView();
            editCategoriesView.Owner = this;
            editCategoriesView.ShowDialog();

            foreach (QuestionCategory qc in QuestionCollection.Categories)
                qc.RaisePropertyChanged("");

            foreach (QuestionCard qc in QuestionCollection.Questions)
                qc.RaisePropertyChanged("");
        }

        private void adminHelp_Click(Object sender, RoutedEventArgs args)
        {
            Presentation.Help.Window1.ShowNow();
        }

        private void SaveAndClose_Click(object sender, RoutedEventArgs e)
        {
            Business.QuestionCollection.saveChanges();
            this.Close();
        }
    }
}
